<div class="path">
    <i class="iconfont icon-shouye1"></i>
    <a href="{url('admin/default/welcome')}">开始</a> / 
    <a href="{url('app/index')}">应用管理</a> 
    {$path}
</div>
<div class="table-head fn-clear">
    <div class="fn-l">
        <a title="添加应用" href="javascript:void(0);" url="{url('app/edit',array('types'=>0))}" class="button button-blue win">
        <i class="iconfont icon-tianjia"></i> 添加应用
        </a>
    </div>
</div>
<div class="m10">
<table class="table table-border">
    <thead>
        <tr>
            <th class="fn-tac w40">#</th>
            <th>模块名称</th>
            <th class="w60 fn-tac">显示</th>
            <th class="w140 fn-tac">最后更新时间</th>
            <th class="fn-tac w100">操作</th>
        </tr>
    </thead>
<tbody>
{loop $list $vo}
<tr>
    <td class="fn-tac">{$vo['id']}</td>
    <td>
    {if $vo['types']==0 || $vo['types']==1 || $vo['types']==2}<a href="{url('app/index',array('pid'=>$vo['rootid']))}">{/if}
    <span class="{if $vo['types']==0}blue fn-fb{elseif $vo['types']==1}green fn-fb{elseif $vo['types']==2}fn-fb{else}gray{/if}">
        {htmlspecialchars_decode($vo['cname'])}
    </span>
    {if $vo['types']==0 || $vo['types']==1 || $vo['types']==2}</a>{/if}
    </td>
    <td class="fn-tac">{if $vo['is_show']}<span class="badge bg-blue">显示</span>{else}<span class="badge">隐藏</span>{/if}</td>
    <td class="fn-tac">{date('Y-m-d H:i:s',$vo['uptime'])}</td>
    <td class="fn-tar">
    <?php $typs = $vo['types']+1;?>   
    {if $vo['types'] <> 3}
    <a title="添加" href="javascript:void(0);" url="{url('app/edit',array(pid=>$vo['id'],'appid'=>$appid,'types'=>$typs))}" class="win button button-blue button-small">
        <i class="iconfont icon-tianjia"></i> 
    </a>
    {/if}
    <a title="编辑" href="javascript:void(0);" url="{url('app/edit',array(id=>$vo['id'],pid=>$vo['pid'],'appid'=>$appid,'types'=> $vo['types']))}" class="win button button-green button-small">
        <i class="iconfont icon-bianji"></i> 
    </a>
    <a title="删除" href="javascript:void(0);" url="{url('app/index',array(id=>$vo['id'],act=>del))}" class="del button  button-yellow button-small">
    <i class="iconfont icon-shanchu"></i> 
    </a>
    </td>
</tr>
{/loop}
</tbody>
</table>
</div>
<script type="text/javascript">
Do('base','dialog',function(){
    $("input[name='sorter']").blur(function(){
        var id = $(this).attr('fid');
        var sid = $(this).val();
        $.post('{url('app/uporter')}',{id:id,sorter:sid})
    });
    $('.win').click(function(){$(this).win();});
    $('.del').click(function(){$(this).del();});
})
</script>